home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / dev / obero / Interfaces3_4.lha / Interfaces / Datatypes.mod < prev    next >
Text File  |  1994-03-05  |  37KB  |  1,060 lines

  1. (*
  2. (*  Amiga Oberon Interface Module:
  3. **  $VER: Datatypes.mod 40.15 (28.12.93) Oberon 3.0
  4. **
  5. **      (C) Copyright 1991-1992 Commodore-Amiga, Inc.
  6. **          All Rights Reserved
  7. **
  8. **      (C) Copyright Oberon Interface 1993 by hartmut Goebel
  9. *)          All Rights Reserved
  10. *)
  11.  
  12. MODULE Datatypes;
  13.  
  14. IMPORT
  15.   d  *:= Dos,
  16.   e  *:= Exec,
  17.   g  *:= Graphics,
  18.   I  *:= Intuition,
  19.   IFF*:= IFFParse,
  20.   prt*:= Printer,
  21.   Rx *:= Rexx,
  22.   u  *:= Utility,
  23.   y  *:=SYSTEM;
  24.  
  25. TYPE
  26.   DataTypeHeaderPtr *= UNTRACED POINTER TO DataTypeHeader;
  27.   HookContextPtr    *= UNTRACED POINTER TO HookContext;
  28.   ToolPtr           *= UNTRACED POINTER TO Tool;
  29.   DataTypePtr       *= UNTRACED POINTER TO DataType;
  30.   ToolNodePtr       *= UNTRACED POINTER TO ToolNode;
  31.   SpecialInfoPtr    *= UNTRACED POINTER TO SpecialInfo;
  32.   MethodPtr         *= UNTRACED POINTER TO Method;
  33.   FrameInfoPtr      *= UNTRACED POINTER TO FrameInfo;
  34.   BitMapHeaderPtr   *= UNTRACED POINTER TO BitMapHeader;
  35.   ColorRegisterPtr  *= UNTRACED POINTER TO ColorRegister;
  36.   VoiceHeaderPtr    *= UNTRACED POINTER TO VoiceHeader;
  37.   LinePtr           *= UNTRACED POINTER TO Line;
  38.  
  39.   LIntArrayPtr      *= UNTRACED POINTER TO ARRAY 10000H OF LONGINT;
  40.  
  41. (*****************************************************************************)
  42.  
  43. CONST
  44.   idDTYP *= y.VAL(LONGINT,"DTYP");
  45.   idDTHD *= y.VAL(LONGINT,"DTHD");
  46.  
  47. TYPE
  48.   MaskPtr *= UNTRACED POINTER TO INTEGER;
  49.     (* I suppose the INTEGER realy is STRUCT b: BOOLEAN; c: BYTE END; *)
  50.  
  51.   DataTypeHeader *= STRUCT
  52.     name     *: e.LSTRPTR; (* Descriptive name of the data type *)
  53.     baseName *: e.LSTRPTR; (* Base name of the data type *)
  54.     pattern  *: e.LSTRPTR; (* Match pattern for file name. *)
  55.     mask     *: MaskPtr;   (* Comparision mask *)
  56.     groupID  *: LONGINT;   (* Group that the DataType is in *)
  57.     id       *: LONGINT;   (* ID for DataType (same as IFF FORM type) *)
  58.     maskLen  *: INTEGER;   (* Length of comparision mask *)
  59.     pad      *: INTEGER;   (* Unused at present (must be 0) *)
  60.     flags    *: SET;       (* Flags *)
  61.     priority *: INTEGER;   (* Priority *)
  62.   END;
  63.  
  64. CONST
  65.   hSize *= SIZE(DataTypeHeader);
  66.  
  67. (* Basic type *)
  68.   typeMaskSet *= y.VAL(SET,000FH);
  69.   typeMask *=  000FH;
  70.   binary   *=  0000H;
  71.   ascii    *=  0001H;
  72.   iff      *=  0002H;
  73.   misc     *=  0003H;
  74.  
  75.   case     *=  0010H;  (* Set if case is important *)
  76.   system1  *=  1000H;  (* Reserved for system use *)
  77.  
  78. (*****************************************************************************
  79.  *
  80.  * GROUP ID and ID
  81.  *
  82.  * This is used for filtering out objects that you don't want.  For
  83.  * example, you could make a filter for the ASL file requester so
  84.  * that it only showed the files that were pictures, or even to
  85.  * narrow it down to only show files that were ILBM pictures.
  86.  *
  87.  * Note that the Group ID's are in lower case, and always the first
  88.  * four characters of the word.
  89.  *
  90.  * For ID's; If it is an IFF file, then the ID is the same as the
  91.  * FORM type.  If it isn't an IFF file, then the ID would be the
  92.  * first four characters of name for the file type.
  93.  *
  94.  *****************************************************************************)
  95.  
  96. CONST
  97.   system     *= y.VAL(LONGINT,"syst");  (* System file, such as; directory,
  98.                                     executable, library, device, font, etc. *)
  99.   text       *= y.VAL(LONGINT,"text");  (* Formatted or unformatted text *)
  100.   document   *= y.VAL(LONGINT,"docu");  (* Formatted text with graphics or other DataTypes *)
  101.   sound      *= y.VAL(LONGINT,"soun");  (* Sound *)
  102.   instrument *= y.VAL(LONGINT,"inst");  (* Musical instruments used for musical scores *)
  103.   music      *= y.VAL(LONGINT,"musi");  (* Musical score *)
  104.   picture    *= y.VAL(LONGINT,"pict");  (* Still picture *)
  105.   animation  *= y.VAL(LONGINT,"anim");  (* Animated picture *)
  106.   movie      *= y.VAL(LONGINT,"movi");  (* Animation with audio track *)
  107.  
  108. (*****************************************************************************)
  109.  
  110. (* A code chunk contains an embedded executable that can be loaded
  111.  * with InternalLoadSeg. *)
  112.   idCode *= y.VAL(LONGINT,"DTCD");
  113.  
  114. TYPE
  115. (* DataTypes comparision hook context (Read-Only).  This is the
  116.  * argument that is passed to a custom comparision routine. *)
  117.   HookContext *= STRUCT
  118.     (* Libraries that are already opened for your use *)
  119.     sysBase      -: e.ExecBasePtr;
  120.     dosBase      -: d.DosLibraryPtr;
  121.     iffParseBase -: e.LibraryPtr;
  122.     utilityBase  -: u.UtilityBasePtr;
  123.  
  124.     (* File context *)
  125.     lock         -: d.FileLockPtr;      (* Lock on the file *)
  126.     fib          -: d.FileInfoBlockPtr; (* Pointer to a FileInfoBlock *)
  127.     fileHandle   -: d.FileHandlePtr;    (* Pointer to the file handle (may be NULL) *)
  128.     iff          -: IFF.IFFHandlePtr;   (* Pointer to an IFFHandle (may be NULL) *)
  129.     buffer       -: e.LSTRPTR;          (* Buffer *)
  130.     bufferLength -: LONGINT;            (* Length of the buffer *)
  131.   END;
  132.  
  133. (*****************************************************************************)
  134.  
  135. CONST
  136.   idTool *= y.VAL(LONGINT,"DTTL");
  137.  
  138. TYPE
  139.   Tool *= STRUCT
  140.     which   *: INTEGER;   (* Which tool is this *)
  141.     flags   *: SET;       (* Flags *)
  142.     program *: e.LSTRPTR; (* Application to use *)
  143.   END;
  144.  
  145. CONST
  146.   tSize *= SIZE(Tool);
  147.  
  148. (* defines for tn_Which *)
  149.   info    *= 1;
  150.   browse  *= 2;
  151.   edit    *= 3;
  152.   print   *= 4;
  153.   mail    *= 5;
  154.  
  155. (* defines for tn_Flags *)
  156.   launchMaskSet *= y.VAL(SET,000FH);
  157.   launchMask *= 000FH;
  158.   shell      *= 0001H;
  159.   workbench  *= 0002H;
  160.   rx         *= 0003H;
  161.  
  162. (*****************************************************************************)
  163.  
  164.   idTags  *= y.VAL(LONGINT,"DTTG");
  165.  
  166. (*****************************************************************************)
  167.  
  168. TYPE
  169.   DataType *= STRUCT
  170.     node1        *: e.Node;            (* Reserved for system use *)
  171.     node2        *: e.Node;            (* Reserved for system use *)
  172.     Header       *: DataTypeHeaderPtr; (* Pointer to the DataTypeHeader *)
  173.     toolList     *: e.List;            (* List of tool nodes *)
  174.     functionName *: e.LSTRPTR;         (* Name of comparision routine *)
  175.     attrList     *: u.TagListPtr;      (* Object creation tags *)
  176.     length       *: LONGINT;           (* Length of the memory block *)
  177.   END;
  178.  
  179. CONST
  180.   nSize *= SIZE(DataType);
  181.  
  182. (*****************************************************************************)
  183.  
  184. TYPE
  185.   ToolNode *= STRUCT
  186.     node   *: e.Node;   (* Embedded node *)
  187.     tool   *: Tool;     (* Embedded tool *)
  188.     Length *: LONGINT;  (* Length of the memory block *)
  189.   END;
  190.  
  191. CONST
  192.   tnSize *= SIZE(ToolNode);
  193.  
  194. (*****************************************************************************)
  195.  
  196.   idNAME *= y.VAL(LONGINT,"NAME");
  197.  
  198. (*****************************************************************************)
  199.  
  200. (* text ID's *)
  201.   errorUnknownDatatype      *= 2000;
  202.   errorCouldntSave          *= 2001;
  203.   errorCouldntOpen          *= 2002;
  204.   errorCouldntSendMessage   *= 2003;
  205.  
  206. (* new for V40 *)
  207.   errorCouldntOpenClipboard *= 2004;
  208.   errorReserved             *= 2005;
  209.   errorUnknownCompression   *= 2006;
  210.   errorNotEnoughData        *= 2007;
  211.   errorInvalidData          *= 2008;
  212.  
  213. (* Offset for types *)
  214.   msgTypeOffset             *= 2100;
  215.  
  216. (*****************************************************************************)
  217.  
  218.   datatypesClass *= "datatypesclass";
  219.  
  220. (*****************************************************************************)
  221.  
  222.   aDummy         *= u.user + 1000H;
  223.  
  224. (* Generic attributes *)
  225.   textAttr       *= aDummy + 10;
  226.       (* (struct TextAttr * ) Pointer to the default TextAttr to use for
  227.        * the text within the object. *)
  228.  
  229.   topVert        *= aDummy + 11;
  230.       (* (LONG) Current top vertical unit *)
  231.  
  232.   visibleVert    *= aDummy + 12;
  233.       (* (LONG) Number of visible vertical units *)
  234.  
  235.   totalVert      *= aDummy + 13;
  236.       (* (LONG) Total number of vertical units *)
  237.  
  238.   vertUnit       *= aDummy + 14;
  239.       (* (LONG) Number of pixels per vertical unit *)
  240.  
  241.   topHoriz       *= aDummy + 15;
  242.       (* (LONG) Current top horizontal unit *)
  243.  
  244.   visibleHoriz   *= aDummy + 16;
  245.       (* (LONG)  Number of visible horizontal units *)
  246.  
  247.   totalHoriz     *= aDummy + 17;
  248.       (* (LONG) Total number of horizontal units *)
  249.  
  250.   horizUnit      *= aDummy + 18;
  251.       (* (LONG) Number of pixels per horizontal unit *)
  252.  
  253.   nodeName       *= aDummy + 19;
  254.       (* (UBYTE * ) Name of the current element within the object. *)
  255.  
  256.   title          *= aDummy + 20;
  257.       (* (UBYTE * ) Title of the object. *)
  258.  
  259.   triggerMethods *= aDummy + 21;
  260.       (* (struct DTMethod * ) Pointer to a NULL terminated array of
  261.        * supported trigger methods. *)
  262.  
  263.   data           *= aDummy + 22;
  264.       (* (APTR) Object specific data. *)
  265.  
  266.   textFont       *= aDummy + 23;
  267.       (* (struct TextFont * ) Default font to use for text within the
  268.        * object. *)
  269.  
  270.   methods        *= aDummy + 24;
  271.       (* (ULONG * ) Pointer to a ~0 terminated array of supported
  272.        * methods. *)
  273.  
  274.   printerStatus  *= aDummy + 25;
  275.       (* (LONG) Printer error message.  Error numbers are defined in
  276.        * <devices/printer.h> *)
  277.  
  278.   printerProc    *= aDummy + 26;
  279.       (* PRIVATE (struct Process * ) Pointer to the print process. *)
  280.  
  281.   layoutProc     *= aDummy + 27;
  282.       (* PRIVATE (struct Process * ) Pointer to the layout process. *)
  283.  
  284.   busy           *= aDummy + 28;
  285.         (* Used to turn the applications' busy pointer off and on *)
  286.  
  287.   sync           *= aDummy + 29;
  288.         (* Used to indicate that new information has been loaded into
  289.          * an object.  This is for models that cache the DTA_TopVert-
  290.          * like tags *)
  291.  
  292.   baseName       *= aDummy + 30;  (* The base name of the class *)
  293.   groupID        *= aDummy + 31;  (* Group that the object must belong in *)
  294.   errorLevel     *= aDummy + 32;  (* Error level *)
  295.   errorNumber    *= aDummy + 33;  (* datatypes.library error number *)
  296.  
  297.   errorString    *= aDummy + 34;  (* Argument for datatypes.library error *)
  298.  
  299.   conductor      *= aDummy + 35;
  300.       (* New for V40. (UBYTE * ) specifies the name of the
  301.        * realtime.library conductor.  Defaults to "Main". *)
  302.  
  303.   controlPanel   *= aDummy + 36;
  304.       (* New for V40. (BOOL) Indicate whether a control panel should be
  305.        * embedded within the object (in the animation datatype, for
  306.        * example).  Defaults to TRUE. *)
  307.  
  308.   immediate      *= aDummy + 37;
  309.       (* New for V40. (BOOL) Indicate whether the object should
  310.        * immediately begin playing.  Defaults to FALSE. *)
  311.  
  312.   repeat         *= aDummy + 38;
  313.       (* New for V40. (BOOL) Indicate that the object should repeat
  314.        * playing.  Defaults to FALSE. *)
  315.  
  316.  
  317. (* DTObject attributes *)
  318.   name           *= aDummy + 100;
  319.   sourceType     *= aDummy + 101;
  320.   handle         *= aDummy + 102;
  321.   dataType       *= aDummy + 103;
  322.   domain         *= aDummy + 104;
  323.  
  324. (* DON'T USE THE FOLLOWING FOUR TAGS.  USE THE CORRESPONDING TAGS IN
  325.  * <intuition/gadgetclass.h> *)
  326.   left           *= aDummy + 105;
  327.   top            *= aDummy + 106;
  328.   width          *= aDummy + 107;
  329.   height         *= aDummy + 108;
  330.  
  331.   objName        *= aDummy + 109;
  332.   objAuthor      *= aDummy + 110;
  333.   objAnnotation  *= aDummy + 111;
  334.   objCopyright   *= aDummy + 112;
  335.   objVersion     *= aDummy + 113;
  336.   objectID       *= aDummy + 114;
  337.   userData       *= aDummy + 115;
  338.   frameInfo      *= aDummy + 116;
  339.  
  340. (* DON'T USE THE FOLLOWING FOUR TAGS.  USE THE CORRESPONDING TAGS IN
  341.  * <intuition/gadgetclass.h> *)
  342.   relRight       *= aDummy + 117;
  343.   relBottom      *= aDummy + 118;
  344.   relWidth       *= aDummy + 119;
  345.   relHeight      *= aDummy + 120;
  346.  
  347.   selectDomain   *= aDummy + 121;
  348.   totalPVert     *= aDummy + 122;
  349.   totalPHoriz    *= aDummy + 123;
  350.   nominalVert    *= aDummy + 124;
  351.   nominalHoriz   *= aDummy + 125;
  352.  
  353. (* Printing attributes *)
  354.   destCols       *= aDummy + 400;
  355.       (* (LONG) Destination X width *)
  356.  
  357.   destRows       *= aDummy + 401;
  358.       (* (LONG) Destination Y height *)
  359.  
  360.   special        *= aDummy + 402;
  361.       (* (UWORD) Option flags *)
  362.  
  363.   rastPort       *= aDummy + 403;
  364.       (* (struct RastPort * ) RastPort to use when printing. (V40) *)
  365.  
  366.   arexxPortName  *= aDummy + 404;
  367.       (* (LSTRPTR) Pointer to base name for ARexx port (V40) *)
  368.  
  369.  
  370. (*****************************************************************************)
  371.  
  372.   stRam       *= 1;
  373.   stFile      *= 2;
  374.   stClipboard *= 3;
  375.   stHotlink   *= 4;
  376.  
  377. (*****************************************************************************)
  378.  
  379. TYPE
  380. (* Attached to the Gadget.SpecialInfo field of the gadget.  Don't access directly,
  381.  * use the Get/Set calls instead.
  382.  *)
  383.   SpecialInfo *= STRUCT
  384.     lock      *: e.SignalSemaphore; (* Locked while in DoAsyncLayout() *)
  385.     flags     *: LONGSET;
  386.  
  387.     topVert   *: LONGINT; (* Top row (in units) *)
  388.     visVert   *: LONGINT; (* Number of visible rows (in units) *)
  389.     totVert   *: LONGINT; (* Total number of rows (in units) *)
  390.     oTopVert  *: LONGINT; (* Previous top (in units) *)
  391.     vertUnit  *: LONGINT; (* Number of pixels in vertical unit *)
  392.  
  393.     topHoriz  *: LONGINT; (* Top column (in units) *)
  394.     visHoriz  *: LONGINT; (* Number of visible columns (in units) *)
  395.     totHoriz  *: LONGINT; (* Total number of columns (in units) *)
  396.     oTopHoriz *: LONGINT; (* Previous top (in units) *)
  397.     horizUnit *: LONGINT; (* Number of pixels in horizontal unit *)
  398.   END;
  399.  
  400. CONST
  401.   layout        *= 0;  (* Object is in layout processing *)
  402.   newsize       *= 1;  (* Object needs to be layed out *)
  403.   dragging      *= 2;
  404.   dragSelect    *= 3;
  405.   highLight     *= 4;
  406.   printing      *= 5;  (* Object is being printed *)
  407.   sifLayoutProc *= 6;  (* Object is in layout process *)
  408.  
  409. (*****************************************************************************)
  410.  
  411. TYPE
  412.   Method *= STRUCT
  413.     label   *: e.LSTRPTR;
  414.     command *: e.LSTRPTR;
  415.     method  *: LONGINT;
  416.   END;
  417.  
  418. (*****************************************************************************)
  419.  
  420. CONST
  421.   mDummy           *= 600H;
  422.   mFrameBox        *= 601H; (* Inquire what environment an object requires *)
  423.   mProcLayout      *= 602H; (* Same as GM_LAYOUT except guaranteed to be on a process already *)
  424.   mAsyncLayout     *= 603H; (* Layout that is occurring on a process *)
  425.   mRemoveObject    *= 604H; (* When a RemoveDTObject() is called *)
  426.  
  427.   mSelect          *= 605H;
  428.   mClearSelected   *= 606H;
  429.  
  430.   mCopy            *= 607H;
  431.   mPrint           *= 608H;
  432.   mAbortPrint      *= 609H;
  433.  
  434.   mNewMember       *= 610H;
  435.   mDisposeMember   *= 611H;
  436.  
  437.   mGoto            *= 630H;
  438.   mTrigger         *= 631H;
  439.  
  440.   mObtainDrawInfo  *= 640H;
  441.   mDraw            *= 641H;
  442.   mReleaseDrawInfo *= 642H;
  443.  
  444.   mWrite           *= 650H;
  445.  
  446. (* Used to ask the object about itself *)
  447. TYPE
  448.   Dimensions *= STRUCT (* used by the following struct *)
  449.     width  *: LONGINT;
  450.     height *: LONGINT;
  451.     depth  *: LONGINT;
  452.   END;
  453.  
  454.   FrameInfo *= STRUCT
  455.     propertyFlags *: LONGINT; (* DisplayInfo (graphics/displayinfo.h) *)
  456.     resolution    *: g.Point; (* DisplayInfo *)
  457.  
  458.     redBits   *: e.UBYTE;
  459.     greenBits *: e.UBYTE;
  460.     blueBits  *: e.UBYTE;
  461.  
  462.     dimensions *: Dimensions;
  463.  
  464.     screen    *: I.ScreenPtr;
  465.     colorMap  *: g.ColorMapPtr;
  466.  
  467.     flags     *: LONGSET;
  468.   END;
  469.  
  470. CONST
  471.   scalable    *= 1;
  472.   scrollable  *= 2;
  473.   remappable  *= 4;
  474.  
  475. TYPE
  476. (* DTM_REMOVEDTOBJECT, DTM_CLEARSELECTED, DTM_COPY, DTM_ABORTPRINT *)
  477.   General *= STRUCT (msg *: I.Msg)
  478.     gInfo *: I.GadgetInfoPtr;
  479.   END;
  480.  
  481. (* DTM_SELECT *)
  482.   Select *= STRUCT (msg *: I.Msg)
  483.     gInfo  *: I.GadgetInfoPtr;
  484.     select *: g.Rectangle;
  485.   END;
  486.  
  487. (* DTM_FRAMEBOX *)
  488.   FrameBox *= STRUCT (msg *: I.Msg)
  489.     gInfo         *: I.GadgetInfoPtr;
  490.     contentsInfo  *: FrameInfoPtr; (* Input *)
  491.     frameInfo     *: FrameInfoPtr; (* Output *)
  492.     sizeFrameInfo *: LONGINT;
  493.     frameFlags    *: LONGSET;
  494.   END;
  495.  
  496. CONST
  497. (* FrameBox.flags *)
  498.   framefSpecify *= 0;  (* Make do with the dimensions of FrameBox provided. *)
  499.  
  500. TYPE
  501. (* DTM_GOTO *)
  502.   Goto *= STRUCT (msg *: I.Msg)
  503.     gInfo    *: I.GadgetInfoPtr;
  504.     nodeName *: e.LSTRPTR;     (* Node to goto *)
  505.     attrList *: u.TagListPtr;  (* Additional attributes *)
  506.   END;
  507.  
  508. (* DTM_TRIGGER *)
  509.   Trigger *= STRUCT (msg *: I.Msg)
  510.     gInfo    *: I.GadgetInfoPtr;
  511.     function *: LONGINT;
  512.     data     *: e.APTR;
  513.   END;
  514.  
  515. CONST
  516.   pause      *= 1;
  517.   play       *= 2;
  518.   contents   *= 3;
  519.   index      *= 4;
  520.   retrace    *= 5;
  521.   browsePrev *= 6;
  522.   browseNext *= 7;
  523.  
  524.   nextField      *= 8;
  525.   prevField      *= 9;
  526.   activateField  *= 10;
  527.  
  528.   command        *= 11;
  529.  
  530. (* New for V40 *)
  531.   rewind      *= 12;
  532.   fastForward *= 13;
  533.   stop        *= 14;
  534.   resume      *= 15;
  535.   locate      *= 16;
  536.  
  537. TYPE
  538. (* DTM_PRINT *)
  539. (* one for each Printer IO request type *)
  540.   PrintStd *= STRUCT (msg *: I.Msg)
  541.     gInfo    *: I.GadgetInfoPtr; (* Gadget information *)
  542.     ios      *: e.IOStdReqPtr;   (* Printer IO request *)
  543.     attrList *: u.TagListPtr;    (* Additional attributes *)
  544.   END;
  545.  
  546.   PrintDRP *= STRUCT (msg *: I.Msg)
  547.     gInfo    *: I.GadgetInfoPtr; (* Gadget information *)
  548.     iodrp    *: prt.IODRPReqPtr; (* Printer IO request *)
  549.     attrList *: u.TagListPtr;    (* Additional attributes *)
  550.   END;
  551.  
  552.   PrintPrtCmd *= STRUCT (msg *: I.Msg)
  553.     gInfo    *: I.GadgetInfoPtr;    (* Gadget information *)
  554.     iopc     *: prt.IOPrtCmdReqPtr; (* Printer IO request *)
  555.     attrList *: u.TagListPtr;       (* Additional attributes *)
  556.   END;
  557.  
  558.  
  559. TYPE
  560. (* DTM_DRAW *)
  561.   Draw *= STRUCT (msg *: I.Msg)
  562.     rPort    *: g.RastPortPtr;
  563.     left     *: LONGINT;
  564.     top      *: LONGINT;
  565.     width    *: LONGINT;
  566.     height   *: LONGINT;
  567.     topHoriz *: LONGINT;
  568.     topVert  *: LONGINT;
  569.     attrList *: u.TagListPtr;  (* Additional attributes *)
  570.   END;
  571.  
  572. (* DTM_WRITE *)
  573.   Write *= STRUCT (msg *: I.Msg)
  574.     gInfo      *: I.GadgetInfoPtr;   (* Gadget information *)
  575.     fileHandle *: d.FileHandlePtr;        (* File handle to write to *)
  576.     mode       *: LONGINT;
  577.     attrList   *: u.TagListPtr;  (* Additional attributes *)
  578.   END;
  579.  
  580. CONST
  581.   wmIff *= 0;    (* Save data as IFF data *)
  582.   wmRaw *= 1;    (* Save data as local data format *)
  583.  
  584. (*****************************************************************************)
  585.  
  586.   pictureDTClass *= "picture.datatype";
  587.  
  588. (*****************************************************************************)
  589.  
  590. (* Picture attributes *)
  591.   modeID        *= aDummy + 200;  (* Mode ID of the picture *)
  592.   bitMapHeader  *= aDummy + 201;
  593.   bitMap        *= aDummy + 202;
  594.         (* Pointer to a class-allocated bitmap, that will end
  595.          * up being freed by picture.class when DisposeDTObject()
  596.          * is called *)
  597.  
  598.   colorRegisters*= aDummy + 203;
  599.   cRegs         *= aDummy + 204;
  600.   gRegs         *= aDummy + 205;
  601.   colorTable    *= aDummy + 206;
  602.   colorTable2   *= aDummy + 207;
  603.   allocated     *= aDummy + 208;
  604.   numColors     *= aDummy + 209;
  605.   numAlloc      *= aDummy + 210;
  606.  
  607.   remap         *= aDummy + 211; (* Boolean : Remap picture (defaults to TRUE) *)
  608.   screen        *= aDummy + 212; (* Screen to remap to *)
  609.  
  610.   freeSourceBitMap *= aDummy + 213; (* Boolean : Free the source bitmap after remapping *)
  611.   grab             *= aDummy + 214; (* Pointer to a Point structure *)
  612.   destBitMap       *= aDummy + 215; (* Pointer to the destination (remapped) bitmap *)
  613.  
  614.   classBitMap      *= aDummy + 216;
  615.         (* Pointer to class-allocated bitmap, that will end
  616.          * up being freed by the class after DisposeDTObject()
  617.          * is called *)
  618.  
  619.   numSparse        *= aDummy + 217;
  620.         (* (UWORD) Number of colors used for sparse remapping *)
  621.  
  622.   sparseTable      *= aDummy + 218;
  623.         (* (UBYTE * ) Pointer to a table of pen numbers indicating
  624.          * which colors should be used when remapping the image.
  625.          * This array must contain as many entries as there
  626.          * are colors specified with PaNumSparse *)
  627.  
  628. (*****************************************************************************)
  629.  
  630. (*  Masking techniques  *)
  631.   hasNone             *= 0;
  632.   hasMask             *= 1;
  633.   hasTransparentColor *= 2;
  634.   hasLasso            *= 3;
  635.   hasAlpha            *= 4;
  636.  
  637. (*  Compression techniques  *)
  638.   mpNone     *= 0;
  639.   mpByteRun1 *= 1;
  640.   mpByteRun2 *= 2;
  641.  
  642. TYPE
  643. (*  Bitmap header (BMHD) structure  *)
  644.   BitMapHeader *= STRUCT
  645.     width       *: INTEGER; (* Width in pixels *)
  646.     height      *: INTEGER; (* Height in pixels *)
  647.     left        *: INTEGER; (* Left position *)
  648.     top         *: INTEGER; (* Top position *)
  649.     depth       *: e.UBYTE; (* Number of planes *)
  650.     masking     *: e.UBYTE; (* Masking type *)
  651.     compression *: e.UBYTE; (* Compression type *)
  652.     pad         *: e.UBYTE;
  653.     transparent *: INTEGER; (* Transparent color *)
  654.     xAspect     *: e.UBYTE;
  655.     yAspect     *: e.UBYTE;
  656.     pageWidth   *: INTEGER;
  657.     pageHeight  *: INTEGER;
  658.   END;
  659.  
  660. (*****************************************************************************)
  661.  
  662. (*  Color register structure *)
  663.   ColorRegister *= STRUCT
  664.     red *, green *, blue *: e.UBYTE;
  665.   END;
  666.  
  667. (*****************************************************************************)
  668.  
  669. CONST
  670. (* IFF types that may be in pictures *)
  671.   idILBM *= y.VAL(LONGINT,"ILBM");
  672.   idBMHD *= y.VAL(LONGINT,"BMHD");
  673.   idBODY *= y.VAL(LONGINT,"BODY");
  674.   idCMAP *= y.VAL(LONGINT,"CMAP");
  675.   idCRNG *= y.VAL(LONGINT,"CRNG");
  676.   idGRAB *= y.VAL(LONGINT,"GRAB");
  677.   idSPRT *= y.VAL(LONGINT,"SPRT");
  678.   idDEST *= y.VAL(LONGINT,"DEST");
  679.   idCAMG *= y.VAL(LONGINT,"CAMG");
  680.  
  681. (*****************************************************************************)
  682.  
  683.   soundDTClass *= "sound.datatype";
  684.  
  685. (*****************************************************************************)
  686.  
  687. (* Sound attributes *)
  688.   sdtaDummy    *= aDummy + 500;
  689.   voiceHeader  *= sdtaDummy + 1;
  690.   sample       *= sdtaDummy + 2;
  691.    (* (UBYTE * ) Sample data *)
  692.  
  693.   sampleLength *= sdtaDummy + 3;
  694.    (* (ULONG) Length of the sample data in UBYTEs *)
  695.  
  696.   period       *= sdtaDummy + 4;
  697.     (* (UWORD) Period *)
  698.  
  699.   volume       *= sdtaDummy + 5;
  700.     (* (UWORD) Volume.        Range from 0 to 64 *)
  701.  
  702.   cycles       *= sdtaDummy + 6;
  703.  
  704. (* The following tags are new for V40 *)
  705.   signalTask   *= sdtaDummy + 7;
  706.     (* (struct Task * ) Task to signal when sound is complete or
  707.       next buffer needed. *)
  708.  
  709.   signalBit    *= sdtaDummy + 8;
  710.     (* (BYTE) Signal bit to use on completion or -1 to disable *)
  711.  
  712.   continuous   *= sdtaDummy + 9;
  713.     (* (ULONG) Playing a continuous stream of data.  Defaults to FALSE. *)
  714.  
  715. (*****************************************************************************)
  716.  
  717.   cmpNone     *= 0;
  718.   cmpFibDelta *= 1;
  719.  
  720. TYPE
  721.   VoiceHeader *= STRUCT
  722.     oneShotHiSamples  *: LONGINT;
  723.     repeatHiSamples   *: LONGINT;
  724.     samplesPerHiCycle *: LONGINT;
  725.     samplesPerSec     *: INTEGER;
  726.     octaves           *: e.UBYTE;
  727.     compression       *: e.UBYTE;
  728.     volume            *: LONGINT;
  729.   END;
  730.  
  731. (*****************************************************************************)
  732.  
  733. CONST
  734. (* IFF types *)
  735.   id8SVX *= y.VAL(LONGINT,"8SVX");
  736.   idVHDR *= y.VAL(LONGINT,"VHDR");
  737.   (* idBODY *= y.VAL(LONGINT,"BODY"); *)
  738.  
  739. (*****************************************************************************)
  740.  
  741.   textDTClass *= "text.datatype";
  742.  
  743. (*****************************************************************************)
  744.  
  745. (* Text attributes *)
  746.   buffer        *= aDummy + 300;
  747.   bufferLen     *= aDummy + 301;
  748.   lineList      *= aDummy + 302;
  749.   wordSelect    *= aDummy + 303;
  750.   wordDelim     *= aDummy + 304;
  751.   wordWrap      *= aDummy + 305;
  752.      (* Boolean. Should the text be word wrapped.  Defaults to false. *)
  753.  
  754. (*****************************************************************************)
  755.  
  756. TYPE
  757. (* There is one Line structure for every line of text in our document.  *)
  758.   Line *= STRUCT
  759.     link    *: e.MinNode; (* to link the lines together *)
  760.     text    *: e.LSTRPTR; (* pointer to the text for this line *)
  761.     textLen *: LONGINT;   (* the character length of the text for this line *)
  762.     xOffset *: INTEGER;   (* where in the line the text starts *)
  763.     yOffset *: INTEGER;   (* line the text is on *)
  764.     width   *: INTEGER;   (* Width of line in pixels *)
  765.     height  *: INTEGER;   (* Height of line in pixels *)
  766.     flags   *: SET;       (* info on the line *)
  767.     fgPen   *: e.BYTE;    (* foreground pen *)
  768.     bgPen   *: e.BYTE;    (* background pen *)
  769.     style   *: LONGINT;   (* Font style *)
  770.     data    *: e.APTR;    (* Link data... *)
  771.   END;
  772.  
  773. (*****************************************************************************)
  774.  
  775. CONST
  776. (* Line.flags *)
  777.   lf       *= 0; (* Line Feed *)
  778.   link     *= 1; (* Segment is a link *)
  779.   object   *= 2; (* ln_Data is a pointer to an DataTypes object *)
  780.   selected *= 3; (* Object is selected *)
  781.  
  782. (*****************************************************************************)
  783.  
  784. (* IFF types that may be text *)
  785.   idFTXT *= y.VAL(LONGINT,"FTXT");
  786.   idCHRS *= y.VAL(LONGINT,"CHRS");
  787.  
  788. (*****************************************************************************)
  789.  
  790.   animationDtClass  *= "animation.datatype";
  791.  
  792. (*****************************************************************************)
  793.  
  794. (* Animation attributes *)
  795.   adtaDummy           *= aDummy + 600;
  796.   adtaModeID          *= modeID;
  797.   adtaKeyFrame        *= bitMap;
  798.         (* (BitMapPtr) Key frame (first frame) bitmap *)
  799.  
  800.   adtaColorRegisters  *= colorRegisters;
  801.   adtaCRegs           *= cRegs;
  802.   adtaGRegs           *= gRegs;
  803.   adtaColorTable      *= colorTable;
  804.   adtaColorTable2     *= colorTable2;
  805.   adtaAllocated       *= allocated;
  806.   adtaNumColors       *= numColors;
  807.   adtaNumAlloc        *= numAlloc;
  808.  
  809.   adtaRemap           *= remap;
  810.         (* (BOOL) : Remap animation (defaults to TRUE) *)
  811.  
  812.   adtaScreen          *= screen;
  813.         (* (ScreenPtr) Screen to remap to *)
  814.  
  815.   adtaNumSparse       *= numSparse;
  816.         (* (INTEGER) Number of colors used for sparse remapping *)
  817.  
  818.   adtaSparseTable     *= sparseTable;
  819.         (* (SHORTINT * ) Pointer to a table of pen numbers indicating
  820.          * which colors should be used when remapping the image.
  821.          * This array must contain as many entries as there
  822.          * are colors specified with ADTA_NumSparse *)
  823.  
  824.   adtaWidth           *= adtaDummy + 1;
  825.   adtaHeight          *= adtaDummy + 2;
  826.   adtaDepth           *= adtaDummy + 3;
  827.   adtaFrames          *= adtaDummy + 4;
  828.         (* (LONGINT) Number of frames in the animation *)
  829.  
  830.   adtaFrame           *= adtaDummy + 5;
  831.         (* (LONGINT) Current frame *)
  832.  
  833.   adtaFramesPerSecond *= adtaDummy + 6;
  834.         (* (LONGINT) Frames per second *)
  835.  
  836.   adtaFrameIncrement  *= adtaDummy + 7;
  837.         (* (LONG) Amount to change frame by when fast forwarding or
  838.          * rewinding.  Defaults to 10. *)
  839.  
  840. (* Sound attributes *)
  841.   adtaSample          *= sample;
  842.   adtaSampleLength    *= sampleLength;
  843.   adtaPeriod          *= period;
  844.   adtaVolume          *= volume;
  845.   adtaCycles          *= cycles;
  846.  
  847. (*****************************************************************************)
  848.  
  849.   idANIM              *= y.VAL(LONGINT,"ANIM");
  850.   idANHD              *= y.VAL(LONGINT,"ANHD");
  851.   idDLTA              *= y.VAL(LONGINT,"DLTA");
  852.  
  853. (*****************************************************************************)
  854. TYPE
  855. (*  Required ANHD structure describes an ANIM frame *)
  856.   AnimHeader *= STRUCT;
  857.     operation    *: SHORTINT;  (*  The compression method:
  858.                                     0  set directly (normal ILBM BODY),
  859.                                     1  XOR ILBM mode,
  860.                                     2  Long Delta mode,
  861.                                     3  Short Delta mode,
  862.                                     4  Generalized short/long Delta mode,
  863.                                     5  Byte Vertical Delta mode
  864.                                     6  Stereo op 5 (third party)
  865.                                    74  (ascii 'J') reserved for Eric Graham's
  866.                                        compression technique (details to be
  867.                                        released later). *)
  868.     mask         *: SHORTSET;  (* (XOR mode only - plane mask where each
  869.                                    bit is set =1 if there is data and =0
  870.                                    if not.) *)
  871.  
  872.     width        *: INTEGER;   (* (XOR mode only - width and height of the *)
  873.     height       *: INTEGER;   (* area represented by the BODY to eliminate
  874.                                   unnecessary un-changed data) *)
  875.  
  876.  
  877.     left         *: INTEGER;   (* (XOR mode only - position of rectangular *)
  878.     top          *: INTEGER;   (* area representd by the BODY) *)
  879.  
  880.  
  881.     absTime      *: LONGINT;   (* Timing for a frame relative to the time
  882.                                   the first frame was displayed, in
  883.                                   jiffies (1/60 sec) *)
  884.  
  885.     relTime      *: LONGINT;   (* Timing for frame relative to time
  886.                                   previous frame was displayed - in
  887.                                   jiffies (1/60 sec) *)
  888.  
  889.     interleave   *: SHORTINT;  (* Indicates how may frames back this data is to
  890.                                   modify.  0 defaults to indicate two frames back
  891.                                   (for double buffering). n indicates n frames back.
  892.                                   The main intent here is to allow values
  893.                                   of 1 for special applications where
  894.                                   frame data would modify the immediately
  895.                                   previous frame. *)
  896.  
  897.     pad0         *: SHORTINT;  (* Pad byte, not used at present. *)
  898.  
  899.     flags        *: LONGINT;   (* 32 option bits used by options=4 and 5.
  900.                                   At present only 6 are identified, but the
  901.                                   rest are set =0 so they can be used to
  902.                                   implement future ideas.  These are defined
  903.                                   for option 4 only at this point.  It is
  904.                                   recommended that all bits be set =0 for
  905.                                   option 5 and that any bit settings
  906.                                   used in the future (such as for XOR mode)
  907.                                   be compatible with the option 4
  908.                                   bit settings.   Player code should check
  909.                                   undefined bits in options 4 and 5 to assure
  910.                                   they are zero.
  911.  
  912.                                   The six bits for current use are:
  913.  
  914.                                    bit #       set =0                  set =1
  915.                                    ===============================================
  916.                                    0           short data              long data
  917.                                    1           set                     XOR
  918.                                    2           separate info           one info list
  919.                                                for each plane          for all planes
  920.                                    3           not RLC                 RLC (run length coded)
  921.                                    4           horizontal              vertical
  922.                                    5           short info offsets      long info offsets
  923.                                *)
  924.  
  925.     pad *: ARRAY 16 OF SHORTINT; (* This is a pad for future use for future
  926.                                     compression modes. *)
  927.   END;
  928.  
  929. (*****************************************************************************)
  930. CONST
  931.  
  932.   adtmDummy           *= 0700H;
  933.  
  934.   adtmLoadFrame       *= 0701H;
  935.     (* Used to load a frame of the animation *)
  936.  
  937.   adtmUnloadFrame     *= 0702H;
  938.     (* Used to unload a frame of the animation *)
  939.  
  940.   adtmStart           *= 0703H;
  941.     (* Used to start the animation *)
  942.  
  943.   adtmPause           *= 0704H;
  944.     (* Used to pause the animation (don't reset the timer) *)
  945.  
  946.   adtmStop            *= 0705H;
  947.     (* Used to stop the animation *)
  948.  
  949.   adtmLocate          *= 0706H;
  950.     (* Used to locate a frame in the animation (as set by a slider...) *)
  951.  
  952. (*****************************************************************************)
  953. TYPE
  954.  
  955. (* ADTM_LOADFRAME, ADTM_UNLOADFRAME *)
  956.   ADTFrame *= STRUCT (msg *: I.Msg)
  957.     timeStamp    *: LONGINT;       (* Timestamp of frame to load *)
  958.  
  959.     (* The following fields are filled in by the ADTM_LOADFRAME method, *)
  960.     (* and are read-only for any other methods. *)
  961.  
  962.     frame        *: LONGINT;       (* Frame number *)
  963.     duration     *: LONGINT;       (* Duration of frame *)
  964.  
  965.     bitMap       *: g.BitMapPtr;   (* Loaded BitMap *)
  966.     cMap         *: g.ColorMapPtr; (* Colormap, if changed *)
  967.  
  968.     sample       *: e.APTR;        (* Sound data *)
  969.     sampleLength *: LONGINT;
  970.     period       *: LONGINT;
  971.  
  972.     userData     *: e.APTR;        (* Used by load frame for extra data *)
  973.   END;
  974.  
  975.  
  976. (* ADTM_START, ADTM_PAUSE, ADTM_STOP, ADTM_LOCATE *)
  977.   ADTStart *= STRUCT (msg *: I.Msg)
  978.     frame        *: LONGINT;       (* Frame # to start at *)
  979.   END;
  980.  
  981. (*****************************************************************************)
  982. CONST
  983.  
  984.   datatypesName *= "datatypes.library";
  985.  
  986. VAR
  987.   base *: e.LibraryPtr;
  988.  
  989. (*--- functions in V40 or higher (Release 3.1) ---*)
  990.  
  991. (* Public entries *)
  992.  
  993. PROCEDURE ObtainDataTypeA     *{base,-024H}(type{0}   : LONGINT;
  994.                                             handle{8} : e.APTR;
  995.                                             attrs{9}  : ARRAY OF u.TagItem): DataTypePtr;
  996. PROCEDURE ObtainDataType      *{base,-024H}(type{0}   : LONGINT;
  997.                                             handle{8} : e.APTR;
  998.                                             tag1{9}.. : u.Tag): DataTypePtr;
  999. PROCEDURE ReleaseDataType     *{base,-02AH}(dt{8}     : DataTypePtr);
  1000. PROCEDURE NewDTObjectA        *{base,-030H}(name{0}   : ARRAY OF CHAR;
  1001.                                             attrs{8}  : ARRAY OF u.TagItem): I.ObjectPtr;
  1002. PROCEDURE NewDTObject         *{base,-030H}(name{0}   : ARRAY OF CHAR;
  1003.                                             tag1{8}.. : u.Tag): I.ObjectPtr;
  1004. PROCEDURE DisposeDTObject     *{base,-036H}(obj{8}    : I.ObjectPtr);
  1005. PROCEDURE SetDTAttrsA         *{base,-03CH}(obj{8}    : I.ObjectPtr;
  1006.                                             win{9}    : I.WindowPtr;
  1007.                                             req{10}   : I.RequesterPtr;
  1008.                                             attrs{11} : ARRAY OF u.TagItem): LONGINT;
  1009. PROCEDURE SetDTAttrs          *{base,-03CH}(obj{8}    : I.ObjectPtr;
  1010.                                             win{9}    : I.WindowPtr;
  1011.                                             req{10}   : I.RequesterPtr;
  1012.                                             tag1{11}..: u.Tag): LONGINT;
  1013. PROCEDURE GetDTAttrsA         *{base,-042H}(obj{8}    : I.ObjectPtr;
  1014.                                             attrs{10} : ARRAY OF u.TagItem):LONGINT;
  1015. PROCEDURE GetDTAttrs          *{base,-042H}(o{8}      : I.ObjectPtr;
  1016.                                             tag1{10}..: u.Tag): LONGINT;
  1017. PROCEDURE AddDTObject         *{base,-048H}(win{8}    : I.WindowPtr;
  1018.                                             req{9}    : I.RequesterPtr;
  1019.                                             obj{10}   : I.ObjectPtr;
  1020.                                             pos{0}    : LONGINT): LONGINT;
  1021. PROCEDURE RefreshDTObjectA    *{base,-04EH}(obj{8}    : I.ObjectPtr;
  1022.                                             win{9}    : I.WindowPtr;
  1023.                                             req{10}   : I.RequesterPtr;
  1024.                                             attrs{11} : ARRAY OF u.TagItem): LONGINT;
  1025. PROCEDURE RefreshDTObject     *{base,-04EH}(obj{8}    : I.ObjectPtr;
  1026.                                             win{9}    : I.WindowPtr;
  1027.                                             req{10}   : I.RequesterPtr;
  1028.                                             tag1{11}..: u.Tag): LONGINT;
  1029. PROCEDURE DoAsyncLayout       *{base,-054H}(obj{8}    : I.ObjectPtr;
  1030.                                             gpl{9}    : I.LayoutPtr);
  1031. PROCEDURE DoDTMethodA         *{base,-05AH}(obj{8}    : I.ObjectPtr;
  1032.                                             win{9}    : I.WindowPtr;
  1033.                                             req{10}   : I.RequesterPtr;
  1034.                                             msg{11}   : I.Msg): LONGINT;
  1035. PROCEDURE DoDTMethod          *{base,-05AH}(obj{8}    : I.ObjectPtr;
  1036.                                             win{9}    : I.WindowPtr;
  1037.                                             req{10}   : I.RequesterPtr;
  1038.                                             msg{11}   : I.Msg): LONGINT;
  1039. PROCEDURE RemoveDTObject      *{base,-060H}(win{8}    : I.WindowPtr;
  1040.                                             obj{9}    : I.ObjectPtr): LONGINT;
  1041. PROCEDURE GetDTMethods        *{base,-066H}(object{8} : I.ObjectPtr): LIntArrayPtr;
  1042. PROCEDURE GetDTTriggerMethods *{base,-06CH}(object{8} : I.ObjectPtr): MethodPtr;
  1043. PROCEDURE PrintDTObjectA      *{base,-072H}(obj{8}    : I.ObjectPtr;
  1044.                                             win{9}    : I.WindowPtr;
  1045.                                             req{10}   : I.RequesterPtr;
  1046.                                             msg{11}   : I.Msg): BOOLEAN;
  1047. PROCEDURE PrintDTObject       *{base,-072H}(obj{8}    : I.ObjectPtr;
  1048.                                             win{9}    : I.WindowPtr;
  1049.                                             req{10}   : I.RequesterPtr;
  1050.                                             data{11}..: e.ADDRESS): BOOLEAN;
  1051. (**)
  1052. PROCEDURE GetDTString         *{base,-08AH}(id{0}: LONGINT): e.LSTRPTR;
  1053.  
  1054. BEGIN
  1055.   base := e.OpenLibrary(datatypesName,39);
  1056. CLOSE
  1057.   IF base # NIL THEN e.CloseLibrary(base); END;
  1058.  
  1059. END Datatypes.
  1060.